package com.qf.fmall.utils;

import com.qf.fmall.user.entity.User;
import org.springframework.util.StringUtils;

public class UserUtils {

    public static void checkUser(User user){

        String username = user.getUsername();
        if (StringUtils.isEmpty(username)) {
            throw new RuntimeException("用户名不能为空");
        }

        String password = user.getPassword();
        if (StringUtils.isEmpty(password)) {
            throw new RuntimeException("密码不能为空");
        }
    }
}
